package HashSetDemo;

import java.util.HashSet;

public class HashSetDemo2 {
    public static void main(String[] args) {
        HashSet<Student> hs = new HashSet<Student>();
        Student s1 = new Student("abner", 30);
        Student s2 = new Student("abner2", 39);
        Student s3 = new Student("abner3", 80);
        Student s4 = new Student("abner3", 880);
        hs.add(s1);
        hs.add(s2);
        hs.add(s3);
        hs.add(s4);
        for (Student s : hs) {
            System.out.println(s.getAge() +"   "+ s.getName());
        }
    }}



